<include file="public@header"/>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('Office/personnel')}">人员管理</a></li>
			<li><a href="{:url('Office/add')}">添加人员</a></li>
            <li class="active"><a href="{:url('Office/editperson',array('id'=>$id))}">编辑人员</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:url('Office/editpersonpost')}">
			<fieldset>
            	<input type="hidden" name="id" value="{$id}">
				<div class="control-group">
					<label class="control-label">账号</label>
					<div class="controls">
						<input type="text" name="user_login" value="{$user_login}" class="form-control" placeholder="请输入登录账号" required>
                        <span class="form-required">*</span>
					</div>
				</div>
                <div class="control-group">
					<label class="control-label">姓名</label>
					<div class="controls">
						<input type="text" name="user_nickname"  value="{$user_nickname}" class="form-control" placeholder="请输入姓名" required>
                        <span class="form-required">*</span>
					</div>
				</div>

                <div class="control-group">
					<label class="control-label">性别</label>
					<div class="controls">
						<select name="sex" class="form-control">
							<option value="1"><php>echo $sex==1?'男':'女'</php></option>
							<option value="2"><php>echo $sex==1?'女':'男'</php></option>
						</select>
					</div>
				</div>
                <div class="control-group">
					<label class="control-label">所属部门</label>
					<div class="controls">
						<select name="dept_id" class="form-control" >
							<volist name="dept" id="vo">
								<option value="{$vo.id}" <if condition="$dept_id eq $vo.id">selected</if>>{$vo.department_name}</option>
							</volist>
						</select>
                        <span class="form-required">*</span>
					</div>
				</div>
                <div class="control-group">
					<label class="control-label">联系电话</label>
					<div class="controls">
						<input type="text" name="mobile"  value="{$mobile}" class="form-control" required>
                        <span class="form-required">*</span>
					</div>
				</div>
                <div class="control-group">
					<label class="control-label">入职时间</label>
					<div class="controls">
						<if ($entry_time == 0) OR ($entry_time == null)>
							<input type="text" class="js-date form-control" name="entry_time" value="">
						<else/>
							<input type="text" class="js-date form-control" name="entry_time" value="{$entry_time|date='Y-m-d'|}">
						</if>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">销售艺术墓权限</label>
					<div class="col-md-6 col-sm-10">
						<label class="radio-inline">
							<php>$active_true_checked=($users['if_sale']==1)?"checked":"";</php>
							<input type="radio" name="if_sale" checked value="1" {$active_true_checked}> 有
						</label>
						<label class="radio-inline">
							<php>$active_true_checked=($users['if_sale']==0)?"checked":"";</php>
							<input type="radio" name="if_sale" value="0" {$active_true_checked}> 无
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">PAD操作权限</label>
					<div class="col-md-6 col-sm-10">
						<label class="radio-inline">
							<php>$active_true_checked=($users['if_pad']==1)?"checked":"";</php>
							<input type="radio" name="if_pad" checked value="1" {$active_true_checked}> 有
						</label>
						<label class="radio-inline">
							<php>$active_true_checked=($users['if_pad']==0)?"checked":"";</php>
							<input type="radio" name="if_pad" value="0" {$active_true_checked}> 无
						</label>
					</div>
				</div>
				<div class="form-group" id="diding_div" <if $users.if_pad == 0>style="display: none"</if>>
					<label class="control-label">PAD抵顶人权限</label>
					<div class="col-md-6 col-sm-10">
						<label class="radio-inline">
							<php>$active_true_checked=($users['if_diding']==1)?"checked":"";</php>
							<input type="radio" name="if_diding"  value="1" {$active_true_checked}> 有
						</label>
						<label class="radio-inline">
							<php>$active_true_checked=($users['if_diding']==0)?"checked":"";</php>
							<input type="radio" name="if_diding" value="0" {$active_true_checked}> 无
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">{:lang('STATUS')}</label>
					<div class="col-md-6 col-sm-10">
						<label class="radio-inline">
							<php>$active_true_checked=($users['user_status']==1)?"checked":"";</php>
							<input type="radio" name="user_status" value="1" {$active_true_checked}> {:lang('正常')}
						</label>
						<label class="radio-inline">
							<php>$active_false_checked=($users['user_status']==0)?"checked":"";</php>
							<input type="radio" name="user_status" value="0" {$active_false_checked}> {:lang('禁用')}
						</label>
					</div>
				</div>
			</fieldset>
			<div class="form-actions">
				<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
				<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
			</div>
		</form>
	</div>
	<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>

	<script type="application/javascript">
        $("input[name='if_pad']").change(function(){
            var pad = $('input:radio[name="if_pad"]:checked').val();
            if(pad == 1){
                $("#diding_div").show();
            }else{
                $('input:radio[name="if_diding"]:first').removeAttr("checked");
                $('input:radio[name="if_diding"]:last').attr('checked', 'true');
                $("#diding_div").hide();
            }
        })
	</script>
</body>
</html>